package driver

import "errors"

/**
 * @Description
 * @Author yichen
 * @Date 2023/9/24 0024 10:55
 **/
type Driver struct {
	name       string
	driverType string
}

type I interface {
	SendTo(channelName string, byte2 []byte) error
}

func NewDriver() *Driver {
	//v = New()
	return &Driver{}
}
func (d *Driver) SendTo(driverType string, channelName string, data []byte) error {

	if driverType == "" {
		driverType = "redis"
	}
	switch driverType {
	case "redis":
		return NewRedisDriver().SendTo(channelName, data)

		break
	case "kafka":
		return NewKafkaDriver().SendTo(channelName, data)
		break
	}
	return errors.New("未找到可用驱动")
}
